SET (PROJECTNAME IncompressibleFlow CACHE STRING "Project & Executable name")
PROJECT(${PROJECTNAME})

CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

INCLUDE(FindConcha OPTIONAL RESULT_VARIABLE CONCHA_MODULE_IMPORTED)

IF(CONCHA_MODULE_IMPORTED)
ELSE(CONCHA_MODULE_IMPORTED)
  MESSAGE (FATAL_ERROR
  "please define CMake var Concha module path : cmake -DCMAKE_MODULE_PATH=/path/to/concha/cmake/modules ../src")
ENDIF(CONCHA_MODULE_IMPORTED)

INCLUDE(ConchaOptions)
INCLUDE(FindConchaExternalLibs)
INCLUDE(FindCBLAS)

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wreturn-type")

INCLUDE_DIRECTORIES(${CONCHA_INCLUDE_DIR})
LINK_DIRECTORIES(${CONCHA_LIBRARY_DIR})

SET(LINKLIBS ConchaModelsIncompressibleFlow ConchaModelsCommon ConchaMethods ConchaMesh Concha ${UMFPACK_LIBRARY} ${ALGLIB_LIBRARY})

IF(BLAS_FOUND)
  LIST(APPEND LINKLIBS ${BLAS_LIBRARY})
ENDIF(BLAS_FOUND)

ADD_EXECUTABLE(../${PROJECTNAME} main.cc)
TARGET_LINK_LIBRARIES(../${PROJECTNAME} ${LINKLIBS})

INCLUDE(ConchaSummary)
